package com.huanletao.dom4j.pojo;

import com.huanletao.dom4j.annotation.ElementFormat;
import lombok.Data;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.math.BigDecimal;
import java.util.Date;
import java.util.StringJoiner;

/**
 * <p>
 *
 * </p>
 *
 * package: com.huanletao.dom4j
 * Description:
 * className: Employee
 * author: 踏雪无痕
 * copyright: Copyright (c) 2022/7/30 9:37
 * since: 1.0.0
 */
@XmlRootElement(name = "Employee")
public class Employee<T> {
    @XmlElement(name = "SSM")
    private Long ssn;
    @XmlElement(name = "name")
    private String name;
    @XmlElement(name = "dateOfBirth")
    @ElementFormat(pattern = "yyyy-MM-dd")
    private Date dateOfBirth;
    @XmlElement(name = "Type")
    private Integer employeeType;
    @XmlElement(name = "salary")
    private BigDecimal salary;
    @XmlElement(name = "body")
    private T body;

    public Long getSsn() {
        return ssn;
    }

    public void setSsn(Long ssn) {
        this.ssn = ssn;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    public Integer getEmployeeType() {
        return employeeType;
    }

    public void setEmployeeType(Integer employeeType) {
        this.employeeType = employeeType;
    }

    public BigDecimal getSalary() {
        return salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }



    @Override
    public String toString() {
        return new StringJoiner(", ", Employee.class.getSimpleName() + "(", ")")
                .add("ssn=" + ssn)
                .add("name='" + name + "'")
                .add("dateOfBirth=" + dateOfBirth)
                .add("employeeType=" + employeeType)
                .add("salary=" + salary)
                .add("body=" + body)
                .toString();
    }
}
